<?php 
/**
 *微博工具
 *@author [cnsecer] <[root@cnsecer.com]>
 * 
 */
namespace Home\Controller; 
use Think\Controller;
class ToolsController  extends CommonController {
	//显示用户所有微博
	public function managewb(){
    	$c   = $this->c;
        $uid = $this->uid; //微博用户UID
        $user_timeline = $c->user_timeline_by_id( $uid,$count = 1);//根据ID获取用户等基本信息
        $this ->totalWB = $user_timeline;
        $count = (string)floor($user_timeline['total_number']/50)+1; //分页总数   
        $page  = new \Think\Page($count,1);// 一次一个分页
        $this->page = $page->show(); //页码   

        $this ->display();
	}
	//批量删除微博
	public function destroy(){
		$c = $this->c;
		$n = 0;
		foreach (I() as $id) {
			foreach($id as $v){
				$result =$c ->delete($v);
				if( isset($result['created_at'])){
					$n++;
				}
			}
				
		}
	   $vo['info'] = "成功删除".$n."条微博";
       // $this->success("成功取消关注".$n."人");
       $this->ajaxReturn($vo,'json');
	}

}
